import { GENDER } from '@/enum/user';
import { ApiProperty } from '@nestjs/swagger';
import { IsMobilePhone, IsNotEmpty } from 'class-validator';

export class UserMessageDto {
  /**
   * 用户id
   */
  userId: number;

  @ApiProperty({
    name: 'sex',
    description: '性别',
    enum: GENDER,
    example: GENDER.BOY,
  })
  @IsNotEmpty({
    message: '性别不能为空',
  })
  sex: GENDER;

  @ApiProperty({
    name: 'age',
    description: '年龄',
    example: 23,
  })
  @IsNotEmpty({
    message: '年龄不能为空',
  })
  age: number;

  @ApiProperty({
    name: 'height',
    description: '身高',
    example: 175,
  })
  @IsNotEmpty({
    message: '身高不能为空',
  })
  height: number;

  @ApiProperty({
    name: 'home',
    description: '家乡',
    example: '广西壮族自治区，贵港市，平南县',
  })
  @IsNotEmpty({
    message: '家乡不能为空',
  })
  home: string;

  @ApiProperty({
    name: 'phone',
    description: '手机号',
    example: '18950676900',
  })
  @IsMobilePhone('zh-CN', {}, { message: '手机号码格式错误' })
  phone: string;

  @ApiProperty({
    name: 'personalTips',
    description: '个人标签',
    example: '18950676900',
  })
  @IsNotEmpty({
    message: '个人标签不能为空',
  })
  personalTips: string;

  @ApiProperty({
    name: 'birthday',
    description: '生日',
    example: '1998-05-12',
  })
  @IsNotEmpty({
    message: '生日不能为空',
  })
  birthday: string;

  @ApiProperty({
    name: 'college',
    description: '所在学院',
    example: '数学与计算机学院',
  })
  @IsNotEmpty({
    message: '所在学院不能为空',
  })
  college: string;

  @ApiProperty({
    name: 'nowStay',
    description: '现在所在城市',
    example: '广西壮族自治区，贵港市，平南县',
  })
  @IsNotEmpty({
    message: '现在所在城市不能为空',
  })
  nowStay: string;
}
